package cn.hhz.spring.example;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestUser {
    public static void main(String[] args) {
        //创建Spring bean对象，放入Ioc容器
        ApplicationContext context= new AnnotationConfigApplicationContext
                ("cn.hhz.spring.example");
        //context.getBean(User.class).var+回车
        User user = context.getBean(User.class);

        user.run();
    }
}
